/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hoteleslab2;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 *
 * @author userlab02
 */
public class Tserializar {
    public void guardar (String archivo,Thotel hotel) throws IOException {
        ObjectOutputStream salida = new ObjectOutputStream(new FileOutputStream(archivo));
        salida.writeObject(hotel);
    }
    public Thotel cargar(String archivo) throws IOException, ClassNotFoundException
    {
        ObjectInputStream entrada = new ObjectInputStream(new FileInputStream(archivo));
        return (Thotel) entrada.readObject();
    }
}
